package com.nbsaas.boot.action.ad;


import com.nbsaas.boot.ad.api.apis.AdApi;
import com.nbsaas.boot.ad.api.domain.request.AdSearch;
import com.nbsaas.boot.ad.api.domain.simple.AdSimple;
import com.nbsaas.boot.rest.response.ListResponse;
import com.nbsaas.boot.rest.response.PageResponse;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Scope("prototype")
@RequestMapping("/action/ad")
@RestController
public class AdAction {


    @RequestMapping("/list")
    public ListResponse<AdSimple> list(AdSearch request) {
        return adApi.list(request);
    }

    @RequestMapping("/search")
    public PageResponse<AdSimple> search(@RequestBody AdSearch request) {
        return adApi.search(request);
    }

    @Resource
    private AdApi adApi;

}
